package com.example.piece.ui.adapter

import android.view.View
import android.widget.Toast
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.module.LoadMoreModule
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.example.base.ext.setCornersPlaceHolderImageUrl
import com.example.piece.BR
import com.example.piece.R
import com.example.piece.databinding.ItemFansBinding
import com.example.piece.databinding.ItemHomeSearchHistoryBinding
import com.example.piece.databinding.ItemMsgBinding
import com.example.piece.databinding.ItemSystemMsgBinding
import com.example.piece.entity.UserAttentionListEntity
import com.example.piece.entity.UserCommentListEntity
import com.example.piece.entity.UserMessageSystemEntity

class FansAdapter :
    BaseQuickAdapter<UserAttentionListEntity, BaseDataBindingHolder<ItemFansBinding>>(
        R.layout.item_fans
    ), LoadMoreModule {


    override fun convert(
        holder: BaseDataBindingHolder<ItemFansBinding>,
        item: UserAttentionListEntity,
    ) {
        val binding =
            holder.dataBinding
        val variable = binding?.setVariable(BR.entity, item)
        binding?.setVariable(BR.adapter, this)
        binding?.setVariable(BR.position, holder.layoutPosition)
        binding?.tvRead?.setOnClickListener { setOnItemChildClick(it, holder.layoutPosition) }
        binding?.imgHead?.setCornersPlaceHolderImageUrl(item.avatar, 90, R.drawable.header_img)
        binding?.executePendingBindings()
    }


}